<script src="../addons/nets_haojk/template/mobile/js/jquery.min.js"></script>
<script src="../addons/nets_haojk/template/mobile/js/swiper.jquery.min.js"></script>
<script src="../addons/nets_haojk/template/mobile/js/ydui.js"></script>
<style>
  
.showdiaglo.pinduoduo{
        position:fixed;
        top:2.5rem;
        left:0.5rem;
         font-size:0.6rem;
          color:#fff;
        padding: 0.1rem 0.15rem;
        background-color:#222;
        opacity: 0.75;
        z-index: 1000000;
        border-radius: 0.08rem;
        overflow: hidden;
      




    }
    .show-img.pinduoduo{
        float: left;
        width: 0.6rem;
        height: 100%;

         width:1.4rem;
    height: 1.4rem;
    margin-right:0.25rem;
    } 
    .show-ar.pinduoduo{
        float: left;
      color: white;
      text-align: center;
      text-overflow: ellipsis;
      width: 4.8rem;
      overflow: hidden;
      white-space: nowrap;
      line-height: 1.6rem;
    }


    .showdiaglo.index{


        position:fixed;
        top:1rem;
        left:0.2rem;
         font-size:0.24rem;
          color:#fff;
        padding: 0.04rem 0.06rem;
        background-color:#222;
        opacity: 0.75;
        z-index: 1000000;
        border-radius: 0.032rem;
        overflow: hidden;

        /*position:fixed;
        top:1rem;
        left:0.2rem;
        height:0.24rem;
        width: 4rem;
        background-color: black;
        opacity: .6;
        border-radius: 0.08rem;
        line-height: 0.6rem;
        z-index: 99999;*/

    }
    .show-img.index{

       float: left;
        width: 0.24rem;
        height: 100%;

         width:0.56rem;
    height:0.56rem;
    margin-right:0.01rem;


        
    } 
    .show-ar.index{


         float: left;
      color: white;
      text-align: center;
      text-overflow: ellipsis;
      width:1.92rem;
      overflow: hidden;
      white-space: nowrap;
      line-height:0.64rem;


       /* float: left;
        color: white;
        text-align: center;
        
       text-overflow: ellipsis; 
       width: 3rem;
overflow: hidden; 
white-space: nowrap;*/
    }
</style>
{php echo register_jssdk(false);} 
<script>
    $(function () {
        //获取当前页index并给导航赋值
        var pageIndex;
        pageIndex = parseInt('<?php echo !empty($_GPC["pix"])? $_GPC["pix"] : 0 ;?>');
        //$('.m-tabbar a').eq(pageIndex).addClass('tabbar-active');
    

    
        //轮播
        var swiper1 = new Swiper('.index-banner', {
            autoplay: 3000,
            pagination: '.index-banner-pagination',
        });
        var swiper2 = new Swiper('.icon-nav-wrapper-box', {
            pagination: '.icon-nav-wrapper-box-pagination',
        });
        var swiper3 = new Swiper('.activity-box', {
            pagination: '.activity-box-pagination',
            loop: true
        });

    });
</script>

<script>

   var do1="{$_GPC['do']}";


      wx.ready(function () {
        sharedata = {
          title: '{$global["title"]}',
          desc: '{$global["remark"]}',
          link: '{$_W["siteurl"]}&is_quan=1&from_uid={$_W["user_info"]["memberid"]}',
          imgUrl: '<?php echo $global["logo"]; ?>',
          success: function(){
            //alert('success');
          },
          cancel: function(){
            //alert('cancel');
          }
        };
        wx.onMenuShareAppMessage(sharedata);
        wx.onMenuShareTimeline(sharedata);
      });
   
	
    $(document).ready(function(){
       
        var cname="{$_GPC['cname']}";
        //alert($("#"+cname).attr('class'));
        console.log($("#"+cname));
        if(do1=="choiceness" && cname!=""){
            $("#"+cname).addClass('tabbar-active-new');
        }else{
            //$(".footerbot a").removeClass('tabbar-active');
        }
        if(do1=="index4"){
            do1="index";
        }
        if(do1=="pinduoduoindex"){
            do1="pddindex";
        }
        if(do1=="pinduoduosearchlist"){
            do1="pddsearch";
        }

        if(do1=="pinduoduoclasslist"){
            do1="pddsearch";
        }
        console.log($("#"+do1));
        $("#"+do1).addClass('tabbar-active-new');
    });
</script>

     {if $_GPC['do']=='index' || $_GPC['do']=='index4' || $_GPC['do']=='pinduoduoindex' }

            <!-- 此处判断为了解决和之前的index  页面样式冲突 -->
          {if $_GPC['do']=='index'}
             <div class="showdiaglo  index " style="display: none;">
                 <img id="tip_avatar  " src="http://wx.qlogo.cn/mmopen/ZruQFDquMHCZZMJPKtzx5kOtFaTaTExYlOs5CQE1mHUV2ZNQ0XGQrsCN8QhKERIScicmmKVMLJlSI1ZPHBu5CNA/0" alt="" class="show-img  index styleimg">
                 <span class="show-ar index" id="tip_tip ">冰镇凉白开 领取了一张100元优惠券</span>
             </div>

          {else if $_GPC['do']=='index4' || $_GPC['do']=='pinduoduoindex'}

             <div class="showdiaglo pinduoduo" style="display: none;">
                 <img id="tip_avatar" src="http://wx.qlogo.cn/mmopen/ZruQFDquMHCZZMJPKtzx5kOtFaTaTExYlOs5CQE1mHUV2ZNQ0XGQrsCN8QhKERIScicmmKVMLJlSI1ZPHBu5CNA/0" alt="" class="show-img pinduoduo  styleimg">
                 <span class="show-ar pinduoduo" id="tip_tip">冰镇凉白开 领取了一张100元优惠券</span>
             </div>


          {/if}


        
        <script type="text/javascript">
            //showdiago();
            var posturltip="{php echo url('entry',array('m'=>'nets_haojk','do'=>'api','oper'=>'AjaxGetOrderTipInfo'))}";
            
            function showdiago(){
                 $.ajax({
                    url:posturltip,
                    data:{},
                    type:"post",
                    success:function(data){
                        var res=JSON.parse(data);
                        // console.log(1)
                        console.log(res);
                         if (res.message=="success"){
                               var array = res.res;
                               var arrayLength = array.length;
                               var arrayI = Math.ceil(Math.random() * arrayLength);


                               setInterval(function () {
                                   arrayI = Math.ceil(Math.random() * arrayLength);

                                   var arrayItem = array[arrayI];
                                   if(arrayItem!=undefined){
                                       // console.log(arrayItem);
                                       //$that.setData({ tipText: arrayItem });
                                       $("#tip_avatar").attr("src",arrayItem.avatar);
                                       $("#tip_tip").html(arrayItem.nickname+" "+arrayItem.tip);
                                       $(".showdiaglo").show();
                                         setTimeout(function(){
                                                $(".showdiaglo").hide(1000);
                                            },2000);
                                    
                                    }
                               }, 8000)

                           }
                       
                    }
                 })


            }
            $(document).ready(function(){
              showdiago();
            });
            
        </script>
    {/if}

    <script>
        function toleveup_zhuan(){
            //跳转到升级赚页面
            console.log("跳转到升级赚页面");
            event.stopPropagation(); 
            return false;
        }
    </script>